package rhc.taskSchedule.entity;

import java.util.Date;

import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

/**不论是调度还是任务执行都需要生成一条正在运行记录，每一个正在运行的任务或调度都会有一个独有的id
 * @author lenovo
 *
 */
@Document(collection="running")
public class Running extends AbstractEntity{

	public static final String COLUMN_RUNNING_TYPE="running_type";
	public static final String COLUMN_RUNNING_START_TYPE="running_start_type";
	public static final String COLUMN_RUNNING_STATUS="running_status";
	public static final String COLUMN_SOURCE_ID="source_id";
	public static final String COLUMN_CREATE_DATE="create_date";
	public static final String COLUMN_RUN_NODE="run_node";
	public static final String COLUMN_START_DATE="start_date";
	public static final String COLUMN_END_DATE="end_date";
	
	/**
	 * 运行类型
	 */
	@Field(value=COLUMN_RUNNING_TYPE)
	private String runningType;
	
	/**
	 * 开始类型，手动还是调度
	 */
	@Field(value=COLUMN_RUNNING_START_TYPE)
	private String runningStartType;
	
	/**
	 * 运行状态
	 */
	@Field(value=COLUMN_RUNNING_STATUS)
	private int runningStatus;
	
	/**
	 * 源id
	 */
	@Field(value=COLUMN_SOURCE_ID)
	private String sourceId;
	
	/**
	 * 创建时间
	 */
	@Field(value=COLUMN_CREATE_DATE)
	private Date createDate;
	
	/**
	 * 运行节点
	 */
	@Field(value=COLUMN_RUN_NODE)
	private String runNode;
	
	/**
	 * 开始时间
	 */
	@Field(value=COLUMN_START_DATE)
	private Date startDate;
	
	/**
	 * 结束时间
	 */
	@Field(value=COLUMN_END_DATE)
	private Date endDate;

	public String getRunningType() {
		return runningType;
	}

	public void setRunningType(String runningType) {
		this.runningType = runningType;
	}

	public String getSourceId() {
		return sourceId;
	}

	public void setSourceId(String sourceId) {
		this.sourceId = sourceId;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getRunNode() {
		return runNode;
	}

	public void setRunNode(String runNode) {
		this.runNode = runNode;
	}

	public String getRunningStartType() {
		return runningStartType;
	}

	public void setRunningStartType(String runningStartType) {
		this.runningStartType = runningStartType;
	}

	public int getRunningStatus() {
		return runningStatus;
	}

	public void setRunningStatus(int runningStatus) {
		this.runningStatus = runningStatus;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
}
